home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1992-09-28 | 6.1 KB | 194 lines |
- '***************************
- '* AMOS Professional *
- '* *
- '* MENUS 6 *
- '* * MENU STYLES
- '* (c) Europress Software *
- '* *
- '* Ronnie Simpson *
- '***************************
- '
- '-------------------------------------------
- 'GENERAL
- '-------------------------------------------
- 'A standard menu is normally displayed as a bar at the top of the screen
- 'with the options running in a vertical column downwards from the titles.
- 'The following commands allow many changes to be made to the menu style
- 'and its position of display on the screen.
- 'Only the basic form of the instruction is shown in the examples and these
- 'can only be used whilst defining your menus.
- 'An optional extended form of each command is available which can be used
- 'to change the menu styles during program execution:-
- '
- 'eg. Menu Line 2 (basic form of the instruction)
- ' Menu Line(2,3) (extended form of the instruction
- '
- '-------------------------------------------
- 'Menu Line
- '-------------------------------------------
- 'display menu options as a horizontal line from the title position
- '
- 'eg. Menu Line 2 (draw items at level 2 as a horizontal line)
- '
- '-------------------------------------------
- 'Menu Tline
- '-------------------------------------------
- 'display menu options as a horizontal line from the left hand edge of screen
- '
- 'eg. Menu Tline 3 (draw items at level 3 as a horizontal line)
- '
- '-------------------------------------------
- 'Menu Bar
- '-------------------------------------------
- 'this is the default mode of menu display for levels 2 to 8
- '
- 'eg. Menu Tline 2 (draw items at level 2 as a vertical bar)
- '
- '-------------------------------------------
- 'Menu Inactive
- '-------------------------------------------
- 'turn off a series of menu options
- '
- 'eg. Menu Inactive 4 (disable selection of level 4 options)
- '
- '-------------------------------------------
- 'Menu Active
- '-------------------------------------------
- 'reverse effect of Menu Inactive
- '
- 'eg. Menu Active 4 (re-enable selection of level 4 options)
- '
- '-------------------------------------------
- 'Menu Static
- '-------------------------------------------
- 'As a default the menu bar may be moved by pressing the left mouse key while
- 'over the first item in a list, Menu Stactic fixes the menu in place.
- '
- 'eg. Menu Static 2 (Disable any movement by user)
- '
- '-------------------------------------------
- 'Menu Movable
- '-------------------------------------------
- 'reverse effect of Menu Static
- '
- 'eg. Menu Movable 3 (Menu may be moved by user)
- '
- '-------------------------------------------
- 'Menu Item Movable
- '-------------------------------------------
- 'allow user to move individual menu items
- '
- 'eg. Menu Item Movable 4 (Menu options may be moved by user)
- '
- 'Before this command has any effect the main menu bar must be movable.
- '
- '-------------------------------------------
- 'Menu Item Static
- '-------------------------------------------
- 'reverse effect of Menu Item Movable
- '
- 'eg. Menu Item Static 3 (Menu options may not be moved by user)
- '
- 'This is the default condition.
- '
- '-------------------------------------------
- 'Menu Separate
- '-------------------------------------------
- 'offset item by 2 pixels
- '
- 'eg. Menu Separate 2 (offset options on level 2)
- '
- 'Only works on items that do not have a background string set.
- '
- '-------------------------------------------
- 'Menu Link
- '-------------------------------------------
- 'reverse effect of Menu Separate
- '
- 'eg. Menu Link 2 (Link options on level 2)
- '
- '-------------------------------------------
- 'Menu Mouse
- '-------------------------------------------
- 'display menu at mouse position
- '
- 'There are 2 possible versions of this instruction:-
- '
- ' Menu Mouse On (display menu at mouse Y coordinate)
- ' Menu Mouse Off (disable this feature)
- '
- '-------------------------------------------
- 'WORKING EXAMPLE
- '-------------------------------------------
- Rem *** tidy up the screen
- '
- Screen Open 0,640,200,16,Hires
- '
- Palette $0,$F00,$F0,$F,$FF,$F0F,$FF0,$F70,$888,$95F,$F07,$5AA,$666,$999,$CCC,$FFF
- Flash Off : Curs Off : Cls 0 : Pen 0 : Paper 11
- '
- Rem *** set the menu titles
- '
- Menu Separate 2
- Menu$(1)=" CONTROL "
- Menu$(2)=" DEMO ITEMS "
- Menu$(3)=" COLOURS "
- '
- Rem *** set the options
- '
- Menu$(1,1)=" QUIT "
- '
- Menu$(2,1)=" MENU MOUSE ON "
- Menu$(2,2)=" MENU MOUSE OFF "
- Menu$(2,3)=" COLOUR OPTIONS MOVABLE "
- Menu$(2,4)=" COLOUR OPTIONS STATIC "
- Menu$(2,5)=" CYAN NOT SELECTABLE "
- Menu$(2,6)=" CYAN SELECTABLE "
- '
- Paper 0
- Pen 1 : Menu$(3,1)=" RED "
- Pen 2 : Menu$(3,2)=" GREEN "
- Pen 3 : Menu$(3,3)=" BLUE "
- Pen 4 : Menu$(3,4)=" CYAN "
- Pen 5 : Menu$(3,5)=" MAGENTA "
- Pen 6 : Menu$(3,6)=" YELLOW "
- Pen 7 : Menu$(3,7)=" ORANGE "
- Pen 8 : Menu$(3,8)=" GREY "
- Pen 9 : Menu$(3,9)=" PURPLE "
- Pen 10 : Menu$(3,10)=" PINK "
- Menu Separate(3,2)
- '
- '
- Rem *** start the automatic checking
- '
- Menu On
- On Menu Proc CONTROL,DEMOS,KOLOURS
- On Menu On
- Pen 9 : Locate 0,23 : Centre "PRESS RIGHT MOUSE KEY TO SEE MENU"
- '
- Rem *** loop whilst waiting for menu
- '
- Do
- Loop
- '
- Procedure CONTROL
- Edit
- End Proc
- '
- Procedure DEMOS
- On Choice(2) Gosub 1,2,3,4,5,6,7
- On Menu On : Pop Proc
- 1 Menu Mouse On : Locate 0,8 : Centre "MENU MOUSE ON " : Return
- 2 Menu Mouse Off : Locate 0,8 : Centre "MENU MOUSE OFF" : Return
- 3 For N=1 To 10 : Menu Movable(3,N) : Next : Locate 0,10 : Centre "TITLE 3 OPTIONS MOVABLE" : Return
- 4 For N=1 To 10 : Menu Static(3,N) : Next : Locate 0,10 : Centre "TITLE 3 OPTIONS STATIC " : Return
- 5 Menu Inactive(3,4) : Locate 0,12 : Pen 7 : Centre "CYAN NOT SELECTABLE" : Return
- 6 Menu Active(3,4) : Locate 0,12 : Centre " CYAN SELECTABLE " : Return
- End Proc
- '
- Procedure KOLOURS
- C=Choice(2)
- Ink C : Pen C
- Locate 0,6 : Centre "NEW COLOUR SELECTED"
- On Menu On
- End Proc